<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="/static/admin/css/login.css?v20180611003" />
    <script type="text/javascript" src="/static/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin.js"></script>
    <title>找回密码</title>
</head>

<body class="login">
    <div class="login_m">
        <div class="login_logo">
            <p class="getpwd_title">
                找回密码
            </p>
        </div>
        <div class="login_boder">
            <div class="login_padding" id="login_model">
                <form id="pwd_form" action="resetpwd" method="POST">
                    <div class="pwd box">
                        <div class="resetpwd">
                            <div class="verify">
                                <h2>输入邮箱验证码 </h2>
                                <label>
                                    <input type="text" id="pwd_verify" name="verify" class="verify_input" placeholder="请输入验证码" autocomplete="verify">
                                </label>
                            </div>
                            <div class="tips">
                                <label><span class="vspan">邮件发送成功, 请注意查收, 若未收到, 请将底部管理员邮箱地址加入白名单</span></label>
                            </div>
                            <div class="password">
                                <h2>NEWPASSWORD</h2>
                                <label>
                                    <input type="password" id="newpwd" name="newpwd" class="txt_input" placeholder="the newpwd" autocomplete="new-password">
                                </label>
                                <span class="pspan"></span>
                            </div>
                            <div class="password">
                                <h2>RENEWPASSWORD</h2>
                                <label>
                                    <input type="password" id="renewpwd" name="renewpwd" class="txt_input" placeholder="the renewpwd" autocomplete="new-password">
                                </label>
                                <span class="rpspan"></span>
                            </div>
                            <div class="button">
                                <label>
                                    <input type="button" class="sub_button" id="pwd_button" value="重置密码">
                                </label>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <!--login_padding  Sign up end-->
        </div>
        <!--login_boder end-->
        <div class="copyrights"> Collect from
            <a href="javascript:void(0);"> {$Think.config.admin_email} </a>
        </div>
    </div>
    <!--login_m end-->

    <script type="text/javascript">
        $(function () {
            $('#button').css('opacity', 0.7).hover(function () {
                $(this).stop().fadeTo(650, 1);
            }, function () {
                $(this).stop().fadeTo(650, 0.7);
            });

            $("#pwd_button").click(function () {
                var newpwd = $("#newpwd").val();
                var renewpwd = $("#renewpwd").val();
                var verify = $("#pwd_verify").val();
                
                if (!checkEmpty(verify, '.vspan', '* 验证不能为空')) return false;

                if (newpwd.match(/^[a-zA-Z]\w{5,17}$/)) {
                    $('.pspan').html("");
                } else {
                    $('.pspan').html("* 新密码必须字母开头，长度在6-18之间，只能包含字符、数字和下划线");
                    return false;
                }

                if (isNull(newpwd) && renewpwd!=newpwd) {
                    $('.pspan').html('两次密码不一致');
                    return false;
                }
                $("#pwd_form").submit();
            });

        });
    </script>

</body>

</html>